package com.fr.privilege.authority;

import com.fr.base.XMLable;
import com.fr.privilege.authentication.Authentication;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public abstract class Control
  implements XMLable
{
  public static final String XML_TAG = "Control";
  protected Map authorityAllocationMap = new HashMap();

  public void addAuthorityAllocation(AuthorityAllocation paramAuthorityAllocation)
  {
    if ((paramAuthorityAllocation == null) || (paramAuthorityAllocation.getAuthority() == null) || (paramAuthorityAllocation.getAuthority().getName() == null))
      return;
    this.authorityAllocationMap.put(paramAuthorityAllocation.getAuthority().getName(), paramAuthorityAllocation);
  }

  public AuthorityAllocation getAuthorityAllocation(String paramString)
  {
    return ((AuthorityAllocation)this.authorityAllocationMap.get(paramString));
  }

  public void clearAuthorityAllocation()
  {
    this.authorityAllocationMap.clear();
  }

  public void clearAuthorityAllocation(String paramString)
  {
    this.authorityAllocationMap.remove(paramString);
  }

  public Iterator authorityAllocationIterator()
  {
    return this.authorityAllocationMap.entrySet().iterator();
  }

  public abstract boolean access(Authentication paramAuthentication, String paramString, int paramInt);

  public abstract String getID();

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}